<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript"> 
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		$("#name").formValidator({onshow:"请输入产品类型名称",onfocus:"请输入产品类型名称",oncorrect:"输入正确"}).inputValidator({min:1,onerror:"请输入产品类型名称"});
//		.ajaxValidator({
//		    type : "get",
//			url : "<?php echo U('attribute/check_model_name_ajax', 'modelid='.$model['id']);?>",
//			data :"",
//			datatype : "html",
//			async:'false',
//			success : function(data){	
//	            if( data == "1" )
//				{
//	                return true;
//				}
//	            else
//				{
//	                return false;
//				}
//			},
//			buttons: $("#dosubmit"),
//			onerror : "产品类型名已存在。",
//			onwait : "请稍候..."
//		});
	})
//-->
</script>

<form name="myform" id="myform" action="__SELF__" method="post">
<div class="pad-10">
<div class="col-tab">
<div class="contentList pad-10">

<table width="100%" class="table_form ">
      <tr>
        <th width="100">产品类型名称：</th>
        <td><input type="text" name="name" id="name" class="input-text" value="<?php echo isset($model['name']) ? $model['name'] : null;?>"/></td>
      </tr>
	  <tr>
        <th width="100">商品类型：</th>
        <td>
			<input type='radio' name='type' value='1' <?php if($model['type']==1) echo 'checked';?>>正常商品 &nbsp;&nbsp;&nbsp;&nbsp;
	        <input type='radio' name='type' value='2' <?php if(!isset($model['type']) || $model['type']==2) echo 'checked';?> >定制商品</td>
		</td>
      </tr>
			<tr>
        <th>属性分组：</th>
        <td>
          <textarea cols="40" rows="5" name="attr_group"><?php echo $model['attr_group'] ? $model['attr_group'] : null;?></textarea><br>
          <span>每行一个商品属性组。排序也将按照自然顺序排序。</span>
        </td>
      </tr>
</table>
</div>
 <div class="bk15"></div>
    <input name="dosubmit" type="submit" value="提交" class="dialog" id="dosubmit">
</div>
</div>
</form>

</body>
</html>